function XSLTLocalCache (browserKey,opt) {			
	var xmlDoc = null;
	var xslDoc = null;
	var xmlString = false;
	var xslString = false;
	var resultDoc = null;
	var key = false;
	var mode = (browserKey!==null)?browserKey:true;
	this.onUnlock = (opt && opt.onUnlock)?(opt.onUnlock):(function(state){});
	
	function returnString(doc) {
		return (new XMLSerializer()).serializeToString(doc);
	}
	
	this.setXmlDoc = function (xml) {
		this.xmlDoc = xml;
		if (this.mode) {
			this.xmlString = returnString(this.xmlDoc);
		}
	};
	this.setXslDoc = function (xml) {
		this.xslDoc = xml;
		if (this.mode) {
			this.xslString = returnString(this.xslDoc);
		}
	};
	
	this.getXmlDoc = function () {
		return this.xmlDoc;
	};
	this.getXmlString = function () {
		if (mode) {
			return this.xmlString;
		} else {
			if (this.xmlDoc) {
				return this.xmlDoc.xml;
			} else {
				return false;
			}
		}
	};
	
	this.getXslDoc = function () {
		return this.xslDoc;
	};
	this.getXslString = function () {
		if (mode) {
			return this.xslString;
		} else {
			if (this.xslDoc) {
				return this.xslDoc.xml;
			} else {
				return false;
			}
		}
	};
	
	this.setResultDoc = function (xml) {
		this.resultDoc = xml;
	};
	this.getResultDoc = function () {
		return this.resultDoc;
	};
	this.getResultString = this.getResultDoc;
	
	this.lock = function () {
		this.key = true;
	};
	this.locked = function () {
		return this.key;
	};
	this.unlock = function () {
		this.key = false;
		this.onUnlock({
			xmlDoc: this.xmlDoc,
			xslDoc: this.xslDoc,
			resultDoc: this.resultDoc
		});
	};
	
	this.checkXmlDoc = function () {
		if (this.xmlDoc) {
			return true;
		}
		return false;
	};
	this.checkXslDoc = function () {
		if (this.xslDoc) {
			return true;
		}
		return false;
	};
	this.checkResultDoc = function () {
		if (this.resultDoc) {
			return true;
		}
		return false;
	};
	
	this.reset = function () {
		this.xmlDoc = null;
		this.xslDoc = null;
		this.resultDoc = null;
	};
	
};